﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DB_NH.DB_Map.YWDF
{
    using NHibernate;
    using NHibernate.Mapping.ByCode;
    using NHibernate.Mapping.ByCode.Conformist;

    using DB_NH.DB_Model.YWDF;

    public class ywdf_order_detail_Map : ClassMapping<ywdf_order_detail>
    {
        public ywdf_order_detail_Map()
        {
            Id(x => x.id, map =>
            {
                map.Length(40);
                map.Column(ywdf_order_detail.Columns.id);
            });
            Property(x => x.is_valid, map => map.Column(ywdf_order_detail.Columns.is_valid));
            Property(x => x.create_date, map => map.Column(ywdf_order_detail.Columns.create_date));

            Property(x => x.count);
            Property(x => x.detail_describe, map => map.Length(10000));
            Property(x => x.order_flag);

            ManyToOne(x => x.order, map => map.Column(ywdf_order_detail.Columns.order_id));

            ManyToOne(x => x.room, map => map.Column(ywdf_order_detail.Columns.room_id));

            Table(ywdf_order_detail.TableName);

            //不进行创建
            SchemaAction(NHibernate.Mapping.ByCode.SchemaAction.None);
        }
    }
}
